﻿<?php

$register_at_station = $this->db->query("select count(*) as total from registers  group by at_station")->result_array();
$register_at_station2 = $this->db->query("select date(create_date) d, count(*) as total from registers where at_station = 1    group by at_station,date(create_date)")->result_array();
$print_register = $this->db->query("select count(*) as total from registers where   last_print_date is not null")->result_array();
$print_register2 = $this->db->query("select date(create_date) d1, date(last_print_date) d2, count(*) as total from registers where   last_print_date is not null group by date(last_print_date);")->result_array();

?>
สรุปทั้งหมด
<br/>
ยอดจาก ลง ทะเบียนทางเน็ต:  <?php echo $register_at_station[0]["total"]; ?> <br/>
ลงทะเบียนที่นี้:  <?php echo $register_at_station[1]["total"]; ?> <br/>
ออก voucher: <?php echo $print_register[0]["total"]; ?> <br/>
<br/>------------------------------------------<br/>
แยก ตามวัน <br/><br/>
<?php foreach($register_at_station2 as $row)
{?>
วันที่   <?php echo $row["d"]; ?>    จำนวนลงทะเบียน  <?php echo $row["total"]; ?>  คน <br/>
<?php } ?>

<br/>
<br/>
<?php foreach($print_register2 as $row)
{?>
วันที่   <?php echo $row["d2"]; ?>    จำนวนออก voucher  <?php echo $row["total"]; ?>  ใบ <br/>
<?php } ?>
